package com.ddwl.gate.controller;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.common.controller.BaseController;
import com.ddwl.gate.service.VoiceService;
import com.ddwl.schema.vo.base.RestVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Fu Zhaohui
 * @date 2017/1/3
 */
@Api(tags = "语音合成服务")
@RestController
@Auth(product = BaseEnum.ProductEnum.TERMINAL)
@RequestMapping("voice")
public class VoiceController extends BaseController {

    @Autowired
    private VoiceService voiceService;

    @GetMapping("/token")
    @ApiOperation("获取语音合成Token")
    public RestVo getAuthCode() {
        return RestVo.ok(voiceService.getToken());
    }

}
